Repository navigation
Conversation
…eral_EventButtonAndData, register allocation differs Taken from draft sourcehold#530 with the style pass applied. Measured on main 592a17d with the four files of this PR in .local, both resolver sets enabled, full build and reccmp. Style: itemIndex instead of param_1, named const text position, COL_C2F0EB/COL_CCFAFF, decimal literals, no redundant cast or unused usings. The only remaining difference is how the colour argument reaches the call: the original pushes the colour immediate in each arm, with the three constant pushes before it hoisted above the branch, while ours keeps the colour in edx and pushes all four after the arms join. The values, the argument order and the call are the same. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…ndtable_Main, register allocation differs Taken from draft sourcehold#530 with the style pass applied. Measured on main 592a17d with the four files of this PR in .local, both resolver sets enabled, full build and reccmp. Style: itemIndex instead of param_1, decimal literals, no unused usings. The only remaining differences are allocation ones: the two waiting-room text index loads (currentAIArray and aiVariationArray) are loaded in the other order into other registers, and the base/index registers of the 9*ai + variation + 231 lea differ. The code is one byte shorter, which moves branch offsets; reccmp's trailing +ret is an artefact of it cutting the original at our length. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…dOptions_Buttons, register allocation differs Taken from draft sourcehold#530 with the style pass applied. Measured on main 592a17d with the four files of this PR in .local, both resolver sets enabled, full build and reccmp. Style: clickType instead of param_1, minValue/maxValue instead of local_4/local_8, BOOLEnum for the genie toggle, comment on the parameter slot reuse. The only remaining differences are allocation ones: the original holds the zero for the sound toggle in eax (xor eax, eax) where ours uses immediates, and the two VolumeSlider out-locals swap stack slots. The jump table entries move by the resulting size difference. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
…tEditor_Scrollbar, register allocation differs Taken from draft sourcehold#530 with the style pass applied. Measured on main 592a17d with the four files of this PR in .local, both resolver sets enabled, full build and reccmp. Style: += for the bottom edge. The only remaining differences are allocation ones: y and x+20 live in other callee-saved registers (edi/ebp swapped), and ours computes top = y - 22 into ebx before the first call where the original computes it after the second; the value and every use are the same. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
- SoundOptions_Buttons: the reset-volume cases pass their own currentValue local instead of reusing the click-type parameter's slot through an enum cast, the comment explaining that form is gone, and the genie toggle tests the flag by truthiness. Re-measured on main 592a17d with a full build and reccmp, unchanged: 87.6 / 97.2 / 86.6 / 82.4, all still register allocation only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
Contributor
Author
|
These forms stay as they are because they are needed for the match. Each was measured with a full build and reccmp on main 592a17d.
|
Each removed cast leaves the generated code and the warnings unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR carries the finished part of draft #530 (
reimpl/ui-menuitems-development). That is four functions where only register allocation is left: their assembly has no functional difference from the original. None of the draft's functions is at 100%, so they are markedRegister allocation differs, not 100%.Measured on
origin/main(592a17d): I ran a full DLL build with exactly these four files incmake/openshc-sources.txt.local. Both resolver sets were switched on: the struct resolvers throughenable_reimplemented_data.pyand the function resolvers throughenable_local_functions.py. I then ran reccmp. To check each diff, I normalized register names and stack slots and confirmed that every remaining line is an allocation difference.MenuItemRenderFunction_General_EventButtonAndData87.6% | Register allocation differsMenuItemRenderFunction_Roundtable_Main97.2% | Register allocation differsleafor9*ai + variation + 231uses other base/index registers. The code is one byte shorter, which shifts branch offsets. reccmp's trailing+retis an artefact of it cutting the original at our length.MenuItemActionHandler_SoundOptions_Buttons86.6% | Register allocation differseax(xor eax, eax) where ours uses immediates. The twoVolumeSliderout-locals swap stack slots. The jump-table entries shift by the size difference.MenuItemRenderFunction_TextEditor_Scrollbar82.4% | Register allocation differsyandx + 20sit in swapped callee-saved registers (edi/ebp). Ours computestop = y - 22intoebxbefore the first call; the original computes it after the second call. The value and all its uses are the same.Style pass: done per
REIMPLEMENTATION_STYLE_GUIDE.mdon main, folded into each function's commit. Every change was re-measured with the full build above, and all four percentages stayed the same.param_1/local_N:itemIndex,clickType,minValue/maxValue.EventButtonAndData.COL_C2F0EB/COL_CCFAFFinstead of raw colours.BOOLEnumfor the genie toggle.+=.SoundOptionspasses its owncurrentValuelocal for the default volume.Header changes: none.
GL / visibility entries: none needed.
Overlap with open PRs: none outside draft #530.
Left in the draft, because differences other than allocation remain:
handleMenuElementsCallbacks(70.7): memory operands are folded into the instructions in one version and loaded separately in the other (add r, [m],cmp [m], imm), and the instruction order differs.MenuItemRenderFunction_BuildingAndStatusMenu_BuildingWorkStatus(89.0): block layout and tail duplication.MenuItemActionHandler_General_CreateEventCallbackFunction(90.0): tail layout aroundplayEventVideoBik.MenuItemActionHandler_UnusedCreateMessageEvent_SetTextUnk(84.0): the original duplicates the case-0x13 tail.Draft #530 stays open for those functions.
Pre-review pass (f8f25ca):
SoundOptionsdrops the reuse of the parameter slot through an enum cast, and the code comment that explained it. The forms that are kept because the match needs them are listed in the PR thread. The four measurements are unchanged.🤖 Generated with Claude Code
https://claude.ai/code/session_01XmXCmXCVBvESeaU1djQFjp